package net.miranti.servlet;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import net.miranti.persistence.PersistenceUtils;

public class PersistenceInitializer implements ServletContextListener {
	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		PersistenceUtils.getEntityManagerFactory("tomcat");
	}

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		PersistenceUtils.closeAll();
	}
}